package cn.lili.timetask.handler.impl.promotion;

import cn.lili.modules.promotion.client.GreenProjectClient;
import cn.lili.timetask.handler.EveryDayExecute;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class GreenProjectEverydayExecute implements EveryDayExecute {

    private final GreenProjectClient greenProjectClient;

    /**
     * 更新绿色公益项目状态
     */
    @Override
    public void execute() {
        try {
            greenProjectClient.updateGreenProjectStatus();
        }catch (Exception e) {
            log.error("更新绿色公益项目状态异常", e);
        }
    }
}
